#include<iostream>
#include<unistd.h>
#include<sys/types.h>
#include<signal.h>

using namespace std;

void handler(int signnum)
{
    cout << "I get a sign from :" << signnum << endl;
    exit(2);
}

int main()
{
    signal(SIGINT, handler);
    while(true)
    {
        cout << "I am a proccess: " << getpid() << endl;
        sleep(1);
    }
    return 0;
}